<template>
  <div class="common-layout">
    <el-container>
      <el-header class="header">小王商城后台管理平台</el-header>
      <el-container>
        <el-aside width="200px">
          <el-radio-group v-model="isCollapse" style="margin-bottom: 20px">
            <el-radio-button :label="false">展开</el-radio-button>
            <el-radio-button :label="true">折叠</el-radio-button>
          </el-radio-group>
          <el-menu
              default-active="/user"
              class="el-menu-vertical-demo"
              :collapse="isCollapse"
              @open="handleOpen"
              @close="handleClose"
              router
          >
            <el-menu-item index="/user">
              <el-icon><icon-menu /></el-icon>
              <template #title>
                用户管理
              </template>
            </el-menu-item>
            <el-menu-item index="/category">
              <el-icon><document /></el-icon>
              <template #title>目录管理</template>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main><router-view/></el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>

import { ref } from 'vue'
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from '@element-plus/icons-vue'
export default {
name: "Admin",
  components:{
    Document,IconMenu,Location,Setting
  },
  setup(){
    const isCollapse = ref(true)
    const handleOpen = () => {
    }
    const handleClose = () => {

    }
    return{isCollapse,handleClose,handleOpen}

  }
}
</script>

<style scoped>

.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}
.header{
  background-color: #333;
  box-sizing: border-box;
  width: 100%;
  height: 70px;
  font-size: 22px;
  color: white;
  position: relative;
  float: left;
  line-height: 70px;

}
</style>
